const ValidatorError = require('../../shared/errors/ValidatorError')
class AuthError extends ValidatorError {
  constructor(message, status = 400) {
    super(message)
    this.status = status
  }
}

class AccountNotFoundError extends AuthError {
  constructor(account) {
    super(`账号【${account}】不存在`)
  }
}

class AccountDisabledError extends AuthError {
  constructor() {
    super('账号已被禁用， 联系管理员开启')
  }
}

class PasswordNotMatchError extends AuthError {
  constructor() {
    super(`密码不正确`)
  }
}

class OldPasswordNotMatchError extends AuthError {
  constructor() {
    super(`旧密码不正确`)
  }
}

module.exports = {
  AccountNotFoundError,
  PasswordNotMatchError,
  AccountDisabledError,
  OldPasswordNotMatchError,
}
